﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="Search.aspx.cs" Inherits="_1041326_1041339_1041433.UserPages.Search" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script src="http://www.google.com/jsapi" type="text/javascript"></script>
    <script language="Javascript" type="text/javascript">//<![CDATA[
        google.load('search', '1');
        google.load("jquery", "1.5.2");
        google.load("jqueryui", "1.8.12");
        function OnLoad() {
            var searchControl = new google.search.SearchControl();
            searchControl.draw();
            //searchControl.execute();

            newSearch = function (form) {
                if (form.input.value) {
                    var searchControl = new google.search.SearchControl();
                    var options = new google.search.SearcherOptions();
                    options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
                    options.setRoot(document.getElementById("somewhere_else"));

                    searchControl.addSearcher(new google.search.WebSearch(), options);
                    searchControl.addSearcher(new google.search.LocalSearch());
                    searchControl.addSearcher(new google.search.BlogSearch());
                    searchControl.draw();
                    searchControl.execute(form.input.value);
                }
                return false;
            }
            var container = document.getElementById("searchFormContainer");
            this.searchForm = new google.search.SearchForm(false, container);
            this.searchForm.setOnSubmitCallback(this, newSearch);
        }
        google.setOnLoadCallback(OnLoad);
    //]]>
    </script>

    <div id="searchFormContainer">
        </div>
    <div id="somewhere_else">
        </div>
</asp:Content>
